home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
workbench
/
libs
/
unixlib.lha
/
unix
/
test
/
dup_test.c
next >
Wrap
C/C++ Source or Header
|
1995-09-05
|
274b
|
19 lines
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
int
main(void)
{
int fd1, fd2;
fd1 = open("pippo", O_WRONLY | O_CREAT | O_TRUNC, 400);
write(fd1, "pluto\n", 6);
fd2 = dup(fd1);
write(fd2, "nave\n", 5);
write(fd1, "prua\n", 5);
close(fd1);
return(0);
}